#include "main.h"
__IO uint16_t Period=0;
/* Main function */
int main (void)
{
	/* Update system clock */
	SystemCoreClockUpdate();
	
	/*Config SysTick interrupt ervery 1ms*/
	SysTick_Config(SystemCoreClock/1000);				
	/*Init SW1 & Led red*/
	printf("\r\nInit SW and Led.....");
	Init_SW1(SW_MODE_EXTI);
	Init_SW2(SW_MODE_EXTI);
	Init_Green();
	Init_Red();
	
	printf("\r\nInit UART0");
	/*Init UART0*/
	UART0_PinConf();
	UART0_Init();                    	
	
	/*Init PIT module*/
	printf("\r\nInit PIT module.....");
	PIT_InitTimer();
	PIT_ConfigValue(TIMER1, 1000);
	PIT_EnableIRQ(TIMER1, MODE_NOCHAIN);
	
	NVIC_EnableIRQ(PORTC_PORTD_IRQn);
	
	while(1){
	}
	return 0;
}
